package com.SmartCare.controller.manager;

import com.SmartCare.common.Result;
import com.SmartCare.pojo.homeInfo.CareHomePriceDetails;
import com.SmartCare.service.homeInfo.PriceDetailsService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 养老院价格详情表 前端控制器
 */
@RestController
@RequestMapping("/price-details")
@Api(tags = "管理端养老院价格信息接口")
public class PriceDetailsController {

    @Resource
    PriceDetailsService pds;

    //添加价格信息
    @PostMapping("/add")
    @Operation(summary = "添加价格信息", description = "新增价格信息，并返回id")
    public Result add(@RequestBody CareHomePriceDetails careHomePriceDetails){
        return pds.add(careHomePriceDetails);
    }
    //修改价格信息
    @PutMapping("/edit")
    @Operation(summary = "修改价格信息", description = "根据id更新价格信息")
    public Result edit(@RequestBody CareHomePriceDetails careHomePriceDetails){
        return pds.edit(careHomePriceDetails);
    }
}

